package com.app.designpatternslearn.behavior.chainofresponsibilitypattern.code

class DefaultHandleChain(private val handles: MutableList<IHandle>) : IHandleChain {

    private var pos = 0

    override fun doHandle() {
        if (pos < handles.size) {
            val iHandle = handles[pos++]
            iHandle.doHandle(this)
        }
    }

}